<html lang="zh">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <title>新增工资条</title>
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/css/font-awesome.min.css" rel="stylesheet" />
    <!-- bootstrap-table 表格插件样式 -->
    <link
            href="/ajax/libs/bootstrap-table/bootstrap-table.min.css"
            rel="stylesheet"
    />
    <link href="/css/animate.css" rel="stylesheet" />
    <link href="/css/style.css" rel="stylesheet" />
    <link href="/feitian/css/ry-ui.css" rel="stylesheet" />

    <link
            rel="stylesheet"
            href="/ajax/libs/layer/theme/default/layer.css?v=3.1.1"
            id="layuicss-layer"
    />
    <link
            rel="stylesheet"
            href="/ajax/libs/layer/theme/moon/style.css"
            id="layuicss-thememoonstylecss"
    />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form
            class="form-horizontal m"
            id="form-sheet-add"
            novalidate="novalidate"
    >
        <div class="form-group">
            <label class="col-sm-3 control-label">用户id：</label>
            <div class="col-sm-8">
                <input
                        name="userId"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出勤天数：</label>
            <div class="col-sm-8">
                <input
                        name="attendanceDay"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">基本工资：</label>
            <div class="col-sm-8">
                <input
                        name="basePay"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">岗位津贴：</label>
            <div class="col-sm-8">
                <input
                        name="jobSubsidies"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">岗位绩效：</label>
            <div class="col-sm-8">
                <input
                        name="jobPerformance"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">全勤奖：</label>
            <div class="col-sm-8">
                <input
                        name="attendanceBonus"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">病假工资：</label>
            <div class="col-sm-8">
                <input
                        name="sickPay"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">未转正工资扣款：</label>
            <div class="col-sm-8">
                <input
                        name="notPositive"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">违纪金：</label>
            <div class="col-sm-8">
                <input
                        name="disciplinaryPay"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">社保：</label>
            <div class="col-sm-8">
                <input
                        name="socialSecurity"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">公积金：</label>
            <div class="col-sm-8">
                <input
                        name="reservedFunds"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">个人所得税：</label>
            <div class="col-sm-8">
                <input
                        name="individualIncome"
                        class="form-control"
                        type="text"
                        required=""
                        aria-required="true"
                />
            </div>
        </div>
        <div class="layui-layer-btn layui-layer-btn-">
            <a class="layui-layer-btn0" id="save">确定</a>
            <a class="layui-layer-btn1" id="back">关闭</a>
        </div>
    </form>
</div>

<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<!-- bootstrap-table 表格插件 -->
<script src="/ajax/libs/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js"></script>
<script src="/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
<script src="/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js"></script>
<!-- jquery-validate 表单验证插件 -->
<script src="/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="/ajax/libs/validate/messages_zh.min.js"></script>
<script src="/ajax/libs/validate/jquery.validate.extend.js"></script>
<!-- jquery-validate 表单树插件 -->
<script src="/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
<!-- jquery-export 表格导出插件 -->
<script src="/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>
<script src="/ajax/libs/bootstrap-table/extensions/export/tableExport.js"></script>
<!-- 遮罩层 -->
<script src="/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="/ajax/libs/iCheck/icheck.min.js"></script>
<script src="/ajax/libs/layer/layer.min.js"></script>
<script src="/ajax/libs/layui/layui.js"></script>
<script src="/feitian/js/common.js?v=4.1.0"></script>
<script src="/feitian/js/ry-ui.js?v=4.1.0"></script>
<script>
    var ctx = "\/";
</script>
<script>
    $(function(){
        addsalarysheet();
    })
    function addsalarysheet(){
        $("#save").click(function(){
            var flag=true;
            var userId=$("#form-overtime-add [name=userId]").val();
            $.ajax({
                url:"/getuserbyid",
                data:{
                    id:userId,
                },
                async:false,
                success:function(data){

                    if (data.userId!=userId){
                        alert("该用户不存在")
                        flag=false;
                    }
                }
            })

            if (flag){
                $.ajax({
                    url:"/system/salarysheet/doadd",
                    data:$("#form-overtime-add").serialize(),
                    success:function(data){
                        if (data>0){
                            alert("添加成功")
                            location.href="/system/salarysheet"
                        }
                    }
                })
            }
        })
        $("#back").click(function (){
            location.href="/system/salarysheet"
        })
    }
</script>

</body>
</html>
